package edu.udlap.spring2008.is300.finalexam.app.mvc.model.database.objects;

import edu.udlap.spring2008.is300.finalexam.framework.mvc.model.database.objects.PrivacyLevelRecord;

/**
 *
 * @author Ruslán Ledesma Garza
 */
public class AppPrivacyLevelRecord implements PrivacyLevelRecord
{

    protected int id_;
    protected String description_;
    
    public AppPrivacyLevelRecord(int id, String description)
    {
        this.id_ = id;
        this.description_ = description;
    }   
    
    @Override
    public int getId()
    {
        return id_;
    }

    @Override
    public String getDescription()
    {
        return description_;
    }

    @Override
    public boolean equals(Object obj)
    {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final AppPrivacyLevelRecord other = (AppPrivacyLevelRecord) obj;
        if (this.id_ != other.id_) {
            return false;
        }
        if (this.description_ != other.description_ && (this.description_ == null || !this.description_.equals(other.description_))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode()
    {
        int hash = 7;
        hash = 17 * hash + this.id_;
        hash = 17 * hash + (this.description_ != null ? this.description_.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString()
    {
        //return "AppPrivacyLevelRecord #" + id_ + ": " + description_;
        return description_;
    }
    
}
